import React, { useState } from 'react'

export default () => {
  return (
    <div>
      <h2>我是售后单管理</h2>
      <div>
        <HocCmp data="hi Hoc"></HocCmp>
      </div>
    </div>
  )
}

const Count = (props) => {
  console.log(props)
  const [count, setCount] = useState(1)
  return (
    <div>
      <div>{count}</div>
      <button onClick={() => setCount(count + 2)}>+</button>
      <div>{props.data}</div>
    </div>
  )
}

const Hoc = (CountCmp) => {
  return (props) => {
    return (
      <CountCmp {...props}></CountCmp>
    )
  }
}

const HocCmp = Hoc(Count)
